package com.group01.mapper;

import com.group01.pojo.User;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

/**
* @author 19559
* @description 针对表【es_user(用户表)】的数据库操作Mapper
* @createDate 2024-06-20 08:47:55
* @Entity com.group01.pojo.User
*/
public interface UserMapper extends BaseMapper<User> {
    // 校验用户名
    @Select("select count(*) from es_user where username = #{username}")
    Integer checkUsername(String username);

    // 校验密码
    @Select("select count(*) from es_user where password = #{password} and id = #{id}")
    Integer checkPassword(Integer id , String password);

    // 登录校验
    @Select("select count(*) from es_user where username = #{username} and password = #{password}")
    Integer checkUserNameAndPassWord(String username, String password);


    // 修改密码
    @Update("update es_user set password = #{entryNewPass} where id = #{id}")
    boolean updatePassword(Integer id, String entryNewPass);
}




